<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title><g:layoutTitle default="Bolão" /></title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <link rel="stylesheet" href="${resource(dir:'css',file:'bolao.css')}" />
    <link rel="stylesheet" href="${resource(dir:'css',file:'superfish.css')}" />
    <link rel="stylesheet" href="${resource(dir:'css/ui-lightness',file:'jquery-ui-1.7.2.custom.css')}" />
    <link rel="shortcut icon" href="${resource(dir:'images',file:'favicon.ico')}" type="image/x-icon" />
    <g:javascript library="application" />
    <g:javascript library="jquery" />
    <%-- TODO: try to use jquery plugin struture--%>
    <script type="text/javascript" src="${resource(dir:'js/jquery',file:'jquery.superfish.js')}"></script>
    <script type="text/javascript" src="${resource(dir:'js/jquery',file:'jquery-ui-1.7.2.custom.min.js')}"></script>
    <script type="text/javascript">

      $(document).ready(function() {
          $('ul.sf-menu').superfish({
              animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation
              delay:         100,
              speed:         'fast'
          });
      });

    </script>
    <g:layoutHead />
  </head>
  <body>
    <div id="spinner" class="spinner" style="display:none;">
      <img src="${resource(dir:'images',file:'spinner.gif')}" alt="Spinner" />
    </div>
    <div id="topbar">
       <g:render template="/common/topbar" />
    </div>
    <div id="header">
      <div id="logo">
        <h1><a href="${resource(dir:'')}"><g:message code="app.title" /></a></h1>
        <h2><g:message code="app.subtitle" /></h2>
      </div>
      <g:isLoggedIn>
        <div class="nav">
          <g:ifAnyGranted role="ROLE_USER">
          <ul class="sf-menu">
            <li>
              <g:link class="list" controller="bet" action="list">
                <g:message code="menu.bets"/>
              </g:link>
            </li>
            <li>
              <g:link class="list" controller="match" action="list">
                <g:message code="menu.matches"/>
              </g:link>
            </li>
            <g:ifAnyGranted role="ROLE_ADMIN">
            <li>
              <a href="#"><g:message code="menu.maintain"/></a>
              <ul>
                <%--
                <li>
                  <a href="#">Teste</a>
                </li>
                --%>
                <li>
                  <a href="#"><g:message code="menu.cups"/></a>
                  <ul>
                    <li>
                      <g:link class="list" controller="cup" action="create">
                        <g:message code="menu.create"/>
                      </g:link>
                    </li>
                    <li>
                      <g:link class="list" controller="cup" action="list">
                        <g:message code="menu.list"/>
                      </g:link>
                    </li>
                  </ul>
                </li>
                <li>
                  <a href="#"><g:message code="menu.groups"/></a>
                  <ul>
                    <li>
                      <g:link class="list" controller="group" action="create">
                        <g:message code="menu.create"/>
                      </g:link>
                    </li>
                    <li>
                      <g:link class="list" controller="group" action="list">
                        <g:message code="menu.list"/>
                      </g:link>
                    </li>
                  </ul>
                </li>
                <li>
                  <a href="#"><g:message code="menu.teams"/></a>
                  <ul>
                    <li>
                      <g:link class="list" controller="team" action="create">
                        <g:message code="menu.create"/>
                      </g:link>
                    </li>
                    <li>
                      <g:link class="list" controller="team" action="list">
                        <g:message code="menu.list"/>
                      </g:link>
                    </li>
                  </ul>
                </li>
                <li>
                  <a href="#"><g:message code="menu.matches"/></a>
                  <ul>
                    <li>
                      <g:link class="list" controller="match" action="create">
                        <g:message code="menu.create"/>
                      </g:link>
                    </li>
                    <li>
                      <g:link class="list" controller="match" action="list">
                        <g:message code="menu.list"/>
                      </g:link>
                    </li>
                  </ul>
                </li>
                <li>
                  <g:link class="list" controller="role" action="list">
                    <g:message code="menu.roles"/>
                  </g:link>
                </li>
                <li>
                  <a href="#"><g:message code="menu.users"/></a>
                  <ul>
                    <li>
                      <g:link class="list" controller="user" action="create">
                        <g:message code="menu.create"/>
                      </g:link>
                    </li>
                    <li>
                      <g:link class="list" controller="user" action="list">
                        <g:message code="menu.list"/>
                      </g:link>
                    </li>
                  </ul>
                </li>
              </ul>
            </li>
            </g:ifAnyGranted>
          </ul>
          </g:ifAnyGranted>
         </div>
      </g:isLoggedIn>
      <%--
      <g:if test="${pageProperty(name: 'page.menu')}">
        <div class="nav">
          <g:pageProperty name="page.menu"/>
        </div>
      </g:if>
      --%>
    </div>
    <div id="bodyWidth">
      <g:layoutBody />
    </div>
    <div id="footer">
      <p id="copy">&copy;2010 <g:message code="app.title" /><br /><g:message code="app.registerBy" /></p>
      <p id="feed"><a href="#" id="rss"><g:message code="app.rss" /></a></p>
    </div>
  </body>
</html>